<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<h1>我的网站</h1>

<p id="demo">一个段落</p>
<div id="myDiv"> 一个div块</div>
<p>
    <button type="button" onclick="myFunction()">单击这里</button>
</p>
<script type="text/javascript">
    function myFunction() {
        var carname = "Voovo";
        document.getElementById("demo").innerHTML = "Hello JavaScript";
        document.getElementById("myDiv").innerHTML = carname;
    }
</script>

</body>
</html>